
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
ast-walker-scope
Advanced tools
Traverse Babel AST with scope information.
Inherited from estree-walker.
npm i ast-walker-scope
For a real example, you can refer to example.ts
import { walk } from 'ast-walker-scope'
const code = `
const a = 'root level'
{
const a = 'second level'
let secondLevel = true
console.log(a, secondLevel)
}
var err = undefined
try {
} catch (err) {
console.log(err)
}
console.log(a)
`.trim()
walk(code, {
leave(this, node) {
if (node.type === 'CallExpression') {
console.log(`\nLevel: ${this.level}`)
for (const [name, node] of Object.entries(this.scope)) {
console.log(
`variable ${name} is located at line ${node.loc?.start.line}, column ${node.loc?.start.column}`
)
}
}
},
})
Output:
Level: 2
variable a is located at line 4, column 8
variable secondLevel is located at line 5, column 6
Level: 2
variable a is located at line 1, column 6
variable err is located at line 12, column 9
Level: 1
variable a is located at line 1, column 6
variable err is located at line 9, column 4
export type Scope = Record<string, Node>
export interface HookContext extends WalkerContext {
// inherited from estree-walker
skip: () => void
remove: () => void
replace: (node: Node) => void
// arguments of estree-walker hook
parent: Node
key: string
index: number
// scope info
scope: Scope
scopes: Scope[]
level: number
}
FAQs
Traverse Babel AST with scope information.
The npm package ast-walker-scope receives a total of 491,047 weekly downloads. As such, ast-walker-scope popularity was classified as popular.
We found that ast-walker-scope demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.